
Api.area()

function choice() {


    var boor = false
    var boortow = false
    var street = document.getElementById("street")
    var rusticate = document.getElementById("rusticate")
    var jd_name = document.getElementById("jd_name")
    var cj_name = document.getElementById("cj_name")

    street.addEventListener("click", function () {
        if (boor) {
            document.getElementsByClassName("jiedao")[0].style.display = "none"
            boor = false
        } else {
            document.getElementsByClassName("jiedao")[0].style.display = "block"
            boor = true
            jd_name.innerHTML=""
            zval.forEach((time,index) => {
                var oli = ` <li data-id=${index}>${time}</li>`
                jd_name.insertAdjacentHTML("beforeend", oli)
            });

         
        }
        $("#jd_name li").on("click", function () {
            street.value=$(this).html() 
            console.log(zm[$(this).attr("data-id")]);
            Api.area(zm[$(this).attr("data-id")])
            cj_name.innerHTML=""
            cval.forEach(time => {
                var oli = ` <li>${time}</li>`
                cj_name.insertAdjacentHTML("beforeend", oli)
            });
            
        })
    
    })




    rusticate.addEventListener("click", function () {
        if (boortow) {
            document.getElementsByClassName("chunju")[0].style.display = "none"
            boortow = false
        } else {
            document.getElementsByClassName("chunju")[0].style.display = "block"

            boortow = true
        }
        cj_name.innerHTML=""
        cval.forEach(time => {
            var oli = ` <li>${time}</li>`
            cj_name.insertAdjacentHTML("beforeend", oli)
        });
        $("#cj_name li").on("click", function () {
            rusticate.value=$(this).html()  
        })
    })
}

choice()
